package bookManageSystem.service;




import bookManageSystem.dao.EmployeeDAO;
import bookManageSystem.po.Employee;

import java.util.List;

public class EmployeeService {
    private EmployeeDAO employeeDAO = new EmployeeDAO();

    // 添加员工（其他业务逻辑方法类似，省略）
    public Boolean addEmployee(Employee employee) {
       return  employeeDAO.addEmployee(employee);
    }

    // 获取所有员工
    public List<Employee> getAllEmployees() {
        return employeeDAO.getAllEmployees();
    }

    public Employee getEmployeeById(int id) {
        return employeeDAO.getEmployeeById(id);
    }

    public Boolean updateEmployee(Employee selectedEmployee) {
        return employeeDAO.updateEmployee(selectedEmployee);
    }

    public Boolean deleteEmployee(int id) {
        return employeeDAO.deleteEmployee(id);
    }

    public Employee getEmployeeByUsername(String username) {
        return employeeDAO.getEmployeeByUsername(username);
    }

    public Boolean updateEmployeeByuserId(Integer userId) {
        return employeeDAO.updateEmployeeByUserId(userId);
    }
}
